package org.jivesoftware.smackx.provider;

import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smackx.packet.Header;
import org.xmlpull.v1.XmlPullParser;

public class HeaderProvider
  implements PacketExtensionProvider
{
  public PacketExtension parseExtension(XmlPullParser paramXmlPullParser)
    throws Exception
  {
    String str1 = paramXmlPullParser.getAttributeValue(null, "name");
    String str2 = null;
    paramXmlPullParser.next();
    if (paramXmlPullParser.getEventType() == 4)
      str2 = paramXmlPullParser.getText();
    while (true)
    {
      if (paramXmlPullParser.getEventType() == 3)
        return new Header(str1, str2);
      paramXmlPullParser.next();
    }
  }
}